package org.jcb.compter.view;




import org.jcb.compter.R;
import org.jcb.compter.model.User;
import org.jcb.compter.presenter.CountPresenter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

public class InitialView extends LinearLayout{
	Button[] buttonChoixLevel = new Button[3] ;
	CountPresenter presenter ;    
	
	public InitialView(Context context, User user, CountPresenter presenter) {
		super(context);
		LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View view=layoutInflater.inflate(R.layout.initial_menu,this);
		
		buttonChoixLevel[0]  = (Button) findViewById(R.id.btnlearnLevel1);
		
		buttonChoixLevel[0].setOnClickListener(new ClicListenerSwitchView(presenter.getLearnView()  , presenter)) ;
	}


private class ClicListenerSwitchView implements View.OnClickListener {
	View view ;
	CountPresenter presenter ;
	
	public ClicListenerSwitchView(View view, CountPresenter presenter) {
		this.view = view ;
		this.presenter = presenter ;
	}
	
	@Override
	public void onClick(View arg0) {
		presenter.switchView(view);		
	}
	
}
	
}


